#region license
# This file is part of Grawlix.
# 
# Grawlix is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
# 
# Grawlix is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public
# License along with Grawlix.  If not, see
# <http://www.gnu.org/licenses/>.
#endregion

"""Untyped value type equality testing."""

namespace Grawlix.Meta.Tests.Equality
import Grawlix.Meta
import NUnit.Framework

[TestFixture]
class UntypedValueEqualityFixture(EqualityAttributeTestCase):

#region wO
	
	[Test]
	def EqualsWO():
		expect wO, \
			not	_.Equals(a), \
			not	_.Equals(b), \
			not	_.Equals(c), \
				_.Equals(d), \
				_.Equals(w), \
			not	_.Equals(x), \
			not	_.Equals(y), \
				_.Equals(z), \
			not	_.Equals(aN), \
			not	_.Equals(bN), \
			not	_.Equals(cN), \
			not	_.Equals(dN), \
			not	_.Equals(aO), \
			not	_.Equals(bO), \
			not	_.Equals(cO), \
				_.Equals(dO), \
				_.Equals(wO), \
			not	_.Equals(xO), \
			not	_.Equals(yO), \
				_.Equals(zO), \
			/* No overload. */ \
		/*		_.Equals(wE), */ \
		/*	not	_.Equals(wU), */ \
			not	_.Equals(oN), \
			not	_.Equals(null)
	
	[Test]
	def EqualOperatorWO():
		expect wO, \
				_ == a, \
			not	_ == b, \
				_ == c, \
				_ == d, \
				_ == w, \
			not	_ == x, \
			not	_ == y, \
				_ == z, \
			not	_ == aN, \
			not	_ == bN, \
			not	_ == cN, \
			not	_ == dN, \
				_ == aO, \
			not	_ == bO, \
				_ == cO, \
				_ == dO, \
				_ == wO, \
			not	_ == xO, \
			not	_ == yO, \
				_ == zO, \
			not	_ == oN, \
				_ == wE, \
			not	_ == wU, \
			not	_ == null
	
	[Test]
	def NotEqualOperatorWO():
		expect wO, \
			not	_ != a, \
				_ != b, \
			not	_ != c, \
			not	_ != d, \
			not	_ != w, \
				_ != x, \
				_ != y, \
			not	_ != z, \
				_ != aN, \
				_ != bN, \
				_ != cN, \
				_ != dN, \
			not	_ != aO, \
				_ != bO, \
			not	_ != cO, \
			not	_ != dO, \
			not	_ != wO, \
				_ != xO, \
				_ != yO, \
			not	_ != zO, \
				_ != oN, \
			not	_ != wE, \
				_ != wU, \
				_ != null

#endregion

#region xO
	
	[Test]
	def EqualsXO():
		expect xO, \
			not	_.Equals(a), \
			not	_.Equals(b), \
			not	_.Equals(c), \
			not	_.Equals(d), \
			not	_.Equals(w), \
				_.Equals(x), \
			not	_.Equals(y), \
			not	_.Equals(z), \
			not	_.Equals(aN), \
			not	_.Equals(bN), \
			not	_.Equals(cN), \
			not	_.Equals(dN), \
			not	_.Equals(aO), \
			not	_.Equals(bO), \
			not	_.Equals(cO), \
			not	_.Equals(dO), \
			not	_.Equals(wO), \
				_.Equals(xO), \
			not	_.Equals(yO), \
			not	_.Equals(zO), \
			/* No overload. */ \
		/*		_.Equals(xE), */ \
		/*	not	_.Equals(xU), */ \
			not	_.Equals(oN), \
			not	_.Equals(null)
	
	[Test]
	def EqualOperatorXO():
		expect xO, \
			not	_ == a, \
			not	_ == b, \
			not	_ == c, \
			not	_ == d, \
			not	_ == w, \
				_ == x, \
			not	_ == y, \
			not	_ == z, \
			not	_ == aN, \
			not	_ == bN, \
			not	_ == cN, \
			not	_ == dN, \
			not	_ == aO, \
			not	_ == bO, \
			not	_ == cO, \
			not	_ == dO, \
			not	_ == wO, \
				_ == xO, \
			not	_ == yO, \
			not	_ == zO, \
			not	_ == oN, \
				_ == xE, \
			not	_ == xU, \
			not	_ == null
	
	[Test]
	def NotEqualOperatorXO():
		expect xO, \
				_ != a, \
				_ != b, \
				_ != c, \
				_ != d, \
				_ != w, \
			not	_ != x, \
				_ != y, \
				_ != z, \
				_ != aN, \
				_ != bN, \
				_ != cN, \
				_ != dN, \
				_ != aO, \
				_ != bO, \
				_ != cO, \
				_ != dO, \
				_ != wO, \
			not	_ != xO, \
				_ != yO, \
				_ != zO, \
				_ != oN, \
			not	_ != xE, \
				_ != xU, \
				_ != null

#endregion

#region yO
	
	[Test]
	def EqualsYO():
		expect yO, \
				_.Equals(a), \
			not	_.Equals(b), \
			not	_.Equals(c), \
			not	_.Equals(d), \
			not	_.Equals(w), \
			not	_.Equals(x), \
			/* Reference equality. */ \
			not	_.Equals(y), \
			not	_.Equals(z), \
			not	_.Equals(aN), \
			not	_.Equals(bN), \
			not	_.Equals(cN), \
			not	_.Equals(dN), \
				_.Equals(aO), \
			not	_.Equals(bO), \
			not	_.Equals(cO), \
			not	_.Equals(dO), \
			not	_.Equals(wO), \
			not	_.Equals(xO), \
			/* Value type reference equality. */ \
			not	_.Equals(yO), \
			not	_.Equals(zO), \
			not	_.Equals(oN), \
			not	_.Equals(null)
	
	[Test]
	def EqualOperatorYO():
		expect yO, \
				_ == a, \
			not	_ == b, \
			not	_ == c, \
			not	_ == d, \
			not	_ == w, \
			not	_ == x, \
			/* Reference equality. */ \
			not	_ == y, \
			not	_ == z, \
			not	_ == aN, \
			not	_ == bN, \
			not	_ == cN, \
			not	_ == dN, \
				_ == aO, \
			not	_ == bO, \
			not	_ == cO, \
			not	_ == dO, \
			not	_ == wO, \
			not	_ == xO, \
			/* Value type reference equality. */ \
				_ == yO, \
			not	_ == zO, \
			not	_ == oN, \
			not	_ == null
	
	[Test]
	def NotEqualOperatorYO():
		expect yO, \
			not	_ != a, \
				_ != b, \
				_ != c, \
				_ != d, \
				_ != w, \
				_ != x, \
			/* Reference equality. */ \
				_ != y, \
				_ != z, \
				_ != aN, \
				_ != bN, \
				_ != cN, \
				_ != dN, \
			not	_ != aO, \
				_ != bO, \
				_ != cO, \
				_ != dO, \
				_ != wO, \
				_ != xO, \
			/* Value type reference equality. */ \
			not	_ != yO, \
				_ != zO, \
				_ != oN, \
				_ != null

#endregion

#region zO
	
	[Test]
	def EqualsZO():
		expect zO, \
			not	_.Equals(a), \
			not	_.Equals(b), \
			not	_.Equals(c), \
			not	_.Equals(d), \
			not	_.Equals(w), \
			not	_.Equals(x), \
			not	_.Equals(y), \
			/* Primitive equality. */ \
				_.Equals(z), \
			not	_.Equals(aN), \
			not	_.Equals(bN), \
			not	_.Equals(cN), \
			not	_.Equals(dN), \
			not	_.Equals(aO), \
			not	_.Equals(bO), \
			not	_.Equals(cO), \
			not	_.Equals(dO), \
			not	_.Equals(wO), \
			not	_.Equals(xO), \
			not	_.Equals(yO), \
			/* Primitive equality. */ \
				_.Equals(zO), \
			not	_.Equals(oN), \
			not	_.Equals(null)
	
	[Test]
	def EqualOperatorZO():
		expect zO, \
				_ == a, \
			not	_ == b, \
			not	_ == c, \
			not	_ == d, \
				_ == w, \
			not	_ == x, \
			not	_ == y, \
			/* Primitive equality. */ \
				_ == z, \
			not	_ == aN, \
			not	_ == bN, \
			not	_ == cN, \
			not	_ == dN, \
				_ == aO, \
			not	_ == bO, \
			not	_ == cO, \
			not	_ == dO, \
				_ == wO, \
			not	_ == xO, \
			not	_ == yO, \
			/* Primitive equality. */ \
				_ == zO, \
			not	_ == oN, \
			not	_ == null
	
	[Test]
	def NotEqualOperatorZO():
		expect zO, \
			not	_ != a, \
				_ != b, \
				_ != c, \
				_ != d, \
			not	_ != w, \
				_ != x, \
				_ != y, \
			/* Primitive equality. */ \
			not	_ != z, \
				_ != aN, \
				_ != bN, \
				_ != cN, \
				_ != dN, \
			not	_ != aO, \
				_ != bO, \
				_ != cO, \
				_ != dO, \
			not	_ != wO, \
				_ != xO, \
				_ != yO, \
			not	_ != zO, \
				_ != oN, \
				_ != null

#endregion
